import request from '@/utils/request'
import BaseApi from '../BaseApi'

/**
 * 角色关联菜单权限
 */
const apiRouter = '/FaSysRoleMenuApi'
export default class FaSysRoleMenu extends BaseApi {
  constructor(gridId) {
    super(apiRouter, gridId)
  }

  /**
   * 获取角色权限
   * @param {*} roleId
   * @returns
   */
  rolePower(roleId) {
    return request({
      url: `${apiRouter}/rolePower/${roleId}`,
      method: 'get'
    })
  }

  /**
   * 设置角色权限
   * @param {*} data
   * @param {*} roleId
   * @returns
   */
  powerSet(data, roleId) {
    return request({
      url: `${apiRouter}/powerSet/${roleId}`,
      method: 'post',
      data
    })
  }
}
